﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MPMusicVids
{
    public partial class ChooseArtist : UserControl
    {
        public string returning = "-1";

        public ChooseArtist(string parsedArtist, string[] possibles, bool flag)
        {
            InitializeComponent();
            label1.Text += parsedArtist;
            for (int i = 0; i < possibles.Length; i++)
            {
                listMatches.Items.Add(possibles[i].Split(';')[0]);
            }
            listMatches.Enabled = flag;
            button1.Enabled = flag;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string toReturn = "-1";
            try
            {
                toReturn = listMatches.SelectedIndex.ToString();
                returning = toReturn;
                this.Hide();
            }
            catch { }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            returning = "#" + txtSearch.Text;
            this.Hide();
        }
    }
}
